<form method="post" class="form-x dux-form form-auto" id="form" action="{:U()}">
    <div class="panel dux-box  active">
        <div class="panel-head">
            <strong>{$name}员工</strong>
        </div>
        <div class="panel-body">
            <div class="form-group">
                <div class="label">
                    <label>员工名称</label>
                </div>
                <div class="field">
                    <input type="text" class="input" id="employee_name" name="employee_name" size="60" datatype="s" value="{$info['employee_name']}">
                    <div class="input-note">当前员工的名称</div>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label>员工艺名</label>
                </div>
                <div class="field">
                    <input type="text" class="input" id="employee_stage_name" name="employee_stage_name" size="60" datatype="s" value="{$info['employee_stage_name']}">
                    <div class="input-note">当前员工的艺名</div>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label>真实姓名</label>
                </div>
                <div class="field">
                    <input type="text" class="input" id="employee_real_name" name="employee_real_name" size="60" datatype="s" value="{$info['employee_real_name']}">
                    <div class="input-note">当前员工真实姓名</div>
                </div>
            </div>

			<div class="form-group">
                <div class="label">
                    <label>是否使用</label>
                </div>
                <div class="field">
					<div class="button-group button-group-small radio">
						
                        <if condition="$info['employee_status'] eq '' OR $info['employee_status'] eq '1'">
                            <label class="button active">
						     <input type="radio" value="1" name="employee_status" checked="checked"> 
                        <else/> 
                            <label class="button">
                            <input type="radio" value="1" name="employee_status"> 
                        </if>                          
						    <span class="icon icon-check"></span> 是
				            </label>
					
                        <if condition="$info['employee_status'] eq '2'">
                            <label class="button active">
						    <input type="radio" value="2" checked="checked" name="employee_status">
                        <else/>
                            <label class="button">
                            <input type="radio" value="2" name="employee_status"> 
                        </if>
						    <span class="icon icon-times"></span> 否
					        </label>
					</div>
                    <div class="input-note">当前员工的状态</div>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label>所属分店</label>
                </div>
                <div class="field">
                    <select class="input" name="store_id">
                        <option value="">--请选择分店--</option>
                        <volist name="storeSearch" id="val">
                        <if condition="$info['store_id'] eq $val['store_id']">
                            <option value="{$val['store_id']}" selected>
                        <else/>
                            <option value="{$val['store_id']}">
                        </if>
                                {$val['cstore_name']}
                            </option>
                        </volist>
                        
                    </select>
                    <div class="input-note">当前员工所在分店</div>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label>所属部门</label>
                </div>
                <div class="field">
                    <select class="input" name="department_id" onchange="getAjaxJob(this)">
                        <option value="">--请选择部门--</option>
                        <volist name="departmentList" id="val">
							<option value="{$val['department_id']}" <eq name="val['department_id']" value="$info['department_id']" > selected</eq>>{$val['department_name']}</option>
                        </volist>
                        
                    </select>
                    <div class="input-note">当前员工所在部门</div>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label>员工职务</label>
                </div>
                <div class="field">
                    <select class="input" name="job_id" id="job_id">
                        <option value=''>--请选择职务--</option>
                        <notempty name="jobList">
                            <option value="{$jobList['job_id']}" selected>
                                {$jobList['job_name']}
                            </option>
                        </notempty>
                    </select>
                    <div class="input-note">当前员工的职务</div>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label>手机号码</label>
                </div>
                <div class="field">
                    <input type="text" class="input" id="employee_mobile" name="employee_mobile" size="60" datatype="m" value="{$info['employee_mobile']}">
                    <div class="input-note">当前员工的手机号码</div>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label>邮箱号码</label>
                </div>
                <div class="field">
                    <input type="text" class="input" id="employee_email" name="employee_email" size="60" datatype="e" value="{$info['employee_email']}">
                    <div class="input-note">当前员工的邮箱</div>
                </div>
            </div>


        </div>
        <div class="panel-foot">
            <div class="form-button">
                <div id="tips"></div>
                <input type="hidden" name="employee_id" type="hidden" value="{$info['employee_id']}">
                <button class="button bg-main" type="submit">保存</button>
                <button class="button bg" type="reset">重置</button>
            </div>
        </div>
    </div>
</form>
<script>
    Do.ready('base', function () {
        $('#form').duxFormPage();
    });

    //ajax获取选中部门下的职务
    function getAjaxJob(obj){
        var department_id = $(obj).val();
        jQuery.ajax({
            url: "{:U('employee/getAjaxJob')}",
            type: "POST",
            data:{"department_id":department_id},
            async:false,
            dataType:"json",
            success: function(json){
                $("#job_id option").remove();
                $("#job_id").append(json);
            }
        });
    }
</script>